﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BattleThis.Core
{
	/// <summary>
	/// Service for Player.
	/// </summary>
	public class PlayerService
	{
		private static IEnumerable<Player> MockPlayerList = CreateMockPlayer();

		private static IEnumerable<Player> CreateMockPlayer()
		{
			var player1 = new Player( new Guid( "75DC9F13-8515-45B1-8028-0518F8233B58" ), "Player A" );
			var player2 = new Player( new Guid( "31C13E03-1C23-49CE-A521-91D5B794E3A2" ), "Player B" );
			var player3 = new Player( new Guid( "C65F19E6-A5D3-4083-BAAA-8E0D476E7560" ), "Player C" );
			var player4 = new Player( new Guid( "FBD28AE7-5674-464A-A9D6-CD3F130DE438" ), "Player D" );

			return new Player[] { player1, player2, player3, player4 };
		}

		/// <summary>
		/// Loads the specified id.
		/// </summary>
		/// <param name="id">The id.</param>
		/// <returns></returns>
		public Player Load ( string name )
		{
			return MockPlayerList.Where( x => x.Name.Equals( name ) ).Single();
		}

	}
}